<!DOCTYPE html>
<html lang="en" >
<head>
    <title>Atomsk - Mode filelist - Pierre Hirel</title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <link rel="stylesheet" media="screen" type="text/css" title="Default" href="./default.css" />
    <link rel="icon" href="../img/atomsk_logo.png" type="image/png" />
</head>
   
<body>

<p><a href="./index.html">Back to main menu</a></p>

<h2>Mode: list</h2>

<h4>Syntax</h4>

<p><code>atomsk --list &#60;listfile&#62; [&#60;formats&#62;] [options]</code></p>


<h4>Description</h4>

<p>In this mode, Atomsk will convert a list of files. This is of course convenient when one has a lot of files to convert, typically snapshots of a molecular dynamics run.</p>

<p>The file &#60;listfile&#62; should contain a list of files to convert. A quick and simple way to build such a file is to list files in a directory and use the redirection symbol "&#62;". For instance:

<p><code>ls * &#62; list.lst</code></p>

<p>In addition the &#60;listfile&#62; has the following specifications:</p>

<ul>
  <li>empty lines, and lines starting with &#35; are ignored (this can be used to insert comments).</li>
  <li>a line containing a file name will trigger the conversion of that file in all formats that are active. If the file is not found, a warning is displayed and Atomsk goes on with the following files.</li>
  <li>a line containing the statement <code>all &#60;format&#62;</code> activates this &#60;format&#62;.</li>
  <li>if a format is specified after a file name, the file will be converted to that format. This applies only to that file, not the following files.</li>
</ul>

<p>As a result, the minimal <code>&#60;listfile&#62;</code> contains only one file name. A recommended, but not mandatory, extension for the <code>&#60;listfile&#62;</code>, is <code>.lst</code>.</p>

<p>The output format(s) can be activated in several ways (also check the list of <a href="./formats.html">supported formats</a>):</p>

<ul>
  <li>in the command-line, several output formats can be specified.</li>
  <li>in the <code>&#60;listfile&#62;</code> with the statement <code>all &#60;format&#62;</code>.</li>
  <li>in the <code>&#60;listfile&#62;</code>, after the name of each file, one &#60;format&#62; can be specified.</li>
</ul>

<p>The output file names are automatically decided after the input file names and the active file format(s).</p>

<p>Note that you can use the mode <code>--list</code> in combination with one or several <a href="./options.html">options</a>. These options will then be applied to all the files converted.</p>



<h4>Examples</h4>

<ul>
<li><code class="command">atomsk --list filelist.lst cfg</code>
<p>This will convert all the files which names are specified in <code>filelist.lst</code> into the CFG format.</p></li>

<li><code class="command">atomsk --list filelist.lst xyz cfg xsf</code>
<p>This will convert all the files which names are specified in <code>filelist.lst</code>, into XYZ, CFG and XSF formats.</p></li>


<li><code class="command">ls *lmc >list.lst &amp;&amp; atomsk -L list.lst xyz cfg</code>
<p>This will list all LAMMPS custom files (LMC) in the current directory, and convert them to XYZ and CFG formats.</p></li>
</ul>


<p><a href="./index.html">Back to main menu</a></p>

</body>

</html>
